/**
 * @param {number[]} nums
 * @return {number}
 */
 var maxAscendingSum = function(nums) {
  let temp = nums[0]
  let res = []
  for(let i=1;i<nums.length;i++){
    if(nums[i]!=undefined && nums[i]>nums[i-1]){
      temp+=nums[i]
    }else {
      res.push(temp)
      temp = nums[i]

    }

  }
  res.push(temp)
  return Math.max(...res)
};

console.log(maxAscendingSum([100,10,1]));